function genconfig( filePath )
%GENCONFIG Generate the singleton of the product configuration file
%   GENCONFIG generate the singleton of the product. The file name of this
%   configuration must be different from any plugins. Generally this file
%   is located in './config/config.mat'. DO NOT CHANGE the code which
%   generate/modify this file, or you may srew the application!
%   
%   INPUT ARGUMENTS
%   filePath: path to the file you want generate(either relative path or absolute path).
%   OUTPUT ARGUMENTS
% 
%   genconfig(filePath);

%   Copyright 2012-2015 Kang M.X. Beijing Normal University.
%   $Revision: 1.0.0 $ $Date: 2014/4/21 16:24:00 $
%   First version for the xml implementation.
%   $Revision: 2.0.0 $ $Date: 2014/4/22 16:55:00 $
%   Abandon the xml implementation. Now it is in the MATLAB MAT
%   implementaion version.

% The first page settings for Amplifier and SyncBox
Config.Amplifier.SamplingRate = 5000;           % set the default samplingrate to 5000Hz
Config.Amplifier.BrainAmpNo = 2;                % set the number of the Brain Amp MR units
Config.Amplifier.RealtimeWindowLength = 20;     % set the window length, which is used by the platform to do the EEG artefact cancellation
Config.SyncBox.Enable = true;                   % set whether enable the SyncBox or not, typically true
Config.SyncBox.ScannerClockFrequency = 20000;   % set the default Scannner Clock Frequency to 20000Hz
Config.SyncBox.DisableSyncMarker = false;       % set whether to display the sync marker(R128) on the screen
Config.SyncBox.SyncMarkerUpdateInterval = 2;    % set the interval of two adjacent sync marker

% The second page settings for the Channel Selection
Config.Channels = { ...
    1,'Fp1','EEG',true,false;
    2,'Fp2','EEG',true,false;
    3,'F3','EEG',true,false;
    4,'F4','EEG',true,false;
    5,'C3','EEG',true,false;
    6,'C4','EEG',true,false;
    7,'P3','EEG',true,false;
    8,'P4','EEG',true,false;
    9,'O1','EEG',true,false;
    10,'O2','EEG',true,false;
    11,'F7','EEG',true,false;
    12,'F8','EEG',true,false;
    13,'T7','EEG',true,false;
    14,'T8','EEG',true,false;
    15,'P7','EEG',true,false;
    16,'P8','EEG',true,false;
    17,'Fz','EEG',true,false;
    18,'Cz','EEG',true,false;
    19,'Pz','EEG',true,false;
    20,'Oz','EEG',true,false;
    21,'FC1','EEG',true,false;
    22,'FC2','EEG',true,false;
    23,'CP1','EEG',true,false;
    24,'CP2','EEG',true,false;
    25,'FC5','EEG',true,false;
    26,'FC6','EEG',true,false;
    27,'CP5','EEG',true,false;
    28,'CP6','EEG',true,false;
    29,'TP9','EEG',true,false;
    30,'Tp10','EEG',true,false;
    31,'POz','EEG',true,false;
    32,'ECG','ECG',true,false;
    33,'F1','EEG',true,false;
    34,'F2','EEG',true,false;
    35,'C1','EEG',true,false;
    36,'C2','EEG',true,false;
    37,'P1','EEG',true,false;
    38,'P2','EEG',true,false;
    39,'AF3','EEG',true,false;
    40,'AF4','EEG',true,false;
    41,'FC3','EEG',true,false;
    42,'FC4','EEG',true,false;
    43,'CP3','EEG',true,false;
    44,'CP4','EEG',true,false;
    45,'PO3','EEG',true,false;
    46,'PO4','EEG',true,false;
    47,'F5','EEG',true,false;
    48,'F6','EEG',true,false;
    49,'C5','EEG',true,false;
    50,'C6','EEG',true,false;
    51,'P5','EEG',true,false;
    52,'P6','EEG',true,false;
    53,'AF7','EEG',true,false;
    54,'AF8','EEG',true,false;
    55,'FT7','EEG',true,false;
    56,'FT8','EEG',true,false;
    57,'TP7','EEG',true,false;
    58,'TP8','EEG',true,false;
    59,'PO7','EEG',true,false;
    60,'PO8','EEG',true,false;
    61,'FT9','EEG',true,false;
    62,'FT10','EEG',true,false;
    63,'FPz','EEG',true,false;
    64,'CPz','EEG',true,false;
    };

% The third page settings for the Storage Configuration
curFilePath = mfilename('fullpath');
curFolerPath = fileparts(curFilePath);
rawFilePath = fullfile(curFolerPath, 'Raw Files');
Config.Storage.StoragePath = rawFilePath;

% The fourth page settings for the Filter Configuration
Config.Filter.HighCutoff = 50;      % 0 for off
Config.Filter.LowCutoff = 0.1;      % 0 for off
Config.Filter.NotchFilter.Enable = false;
Config.Filter.NotchFilter.Frequency = 50;


% Save the configuration
save(filePath, 'Config', '-v7.3');
end

